{{agent_name_pascal}}Agent
What it is
- A template agent class that subclasses
naas_abi_core.services.agent.Agent.Agent. - Provides a single factory method (
New) to create a configured agent instance using a ChatGPT model.
Public API
- Constants
NAME: Agent name ("{{agent_name_pascal}}Agent").DESCRIPTION: Human-readable description.SYSTEM_PROMPT: Default system prompt used when no configuration is provided.
- Class
{{agent_name_pascal}}Agent(Agent)@classmethod New(agent_shared_state: Optional[AgentSharedState] = None, agent_configuration: Optional[AgentConfiguration] = None) -> "{{agent_name_pascal}}Agent"- Creates and returns a new agent instance.
- Behavior:
- Imports the ChatGPT model from
naas_abi_marketplace.ai.chatgpt.models.gpt_5and useschatgpt_model.model. - If
agent_configurationis not provided, buildsAgentConfiguration(system_prompt=SYSTEM_PROMPT). - If
agent_shared_stateis not provided, builds a newAgentSharedState(). - Creates the agent with empty
toolsandagents, andmemory=None.
- Imports the ChatGPT model from
Configuration/Dependencies
- Depends on
naas_abi_core.services.agent.Agent:Agent,AgentConfiguration,AgentSharedState
naas_abi_marketplace.ai.chatgpt.models.gpt_5:model(used as the agent chat model)
- Configuration
AgentConfigurationcan be passed in; otherwise a default is created withsystem_prompt=SYSTEM_PROMPT.
Usage
# Assuming the templated class has been generated with a real name, e.g. MyAgent
from my_package.MyAgent import MyAgent # adjust import to your project layout
agent = MyAgent.New()
With explicit configuration/state:
from naas_abi_core.services.agent.Agent import AgentConfiguration, AgentSharedState
from my_package.MyAgent import MyAgent # adjust import
state = AgentSharedState()
config = AgentConfiguration(system_prompt="You are a custom agent.")
agent = MyAgent.New(agent_shared_state=state, agent_configuration=config)
Caveats
toolsandagentsare always initialized as empty lists inNew; this template does not register any tools/sub-agents by default.memoryis set toNoneby default.